<div class="legend">
  Explore all peptide spectrum matches based on the following selection. By changing one selection all remaining boxes right to it and the shown spectrum will be updated.<br />
  The spectra are visualized by the JQuery plug-in <a href="http://code.google.com/p/lorikeet/" target="_blank">lorikeet</a>.
</div>
<div class="msSelection">
  <g:formRemote url="[controller:'Protein', action:'showLorikeet']" update="lorikeetPlace" name="showLorikeet">
    <g:if test="${Select.size()==1}"><g:hiddenField name="msHiddenProject" value="${(Select.keySet() as String[])[0]}" /></g:if>
    <div class="msProject msSelectionElement">
      <div class="msSelectionTitle">Experiment</div>
      <select id="msProject" name="msProject">
        <g:each in="${Select.keySet()}" var="proj">
          <option value="${proj}" <g:if test="${DefaultSelected.project==proj}">selected="selected"</g:if>>${Projects[proj]}</option>
        </g:each>
      </select>
    </div>
    <div class="msPeptide msSelectionElement">
      <div class="msSelectionTitle">Peptide</div>
      <select id="msPeptide" name="msPeptide">
        <g:each in="${Select.keySet()}" var="proj">
          <g:each in="${Select[proj].keySet()}" var="peptide">
            <option value="${peptide}" class="${proj}" <g:if test="${DefaultSelected.peptide==peptide}">selected="selected"</g:if>>${Peptides[peptide]}</option>
          </g:each>
        </g:each>
      </select>
    </div>
    <div class="msCsl msSelectionElement">
      <div class="msSelectionTitle">Tissue of origin</div>
      <select id="msCls" name="msCls">
        <g:each in="${Select.keySet()}" var="proj">
          <g:each in="${Select[proj].keySet()}" var="peptide">
            <g:each in="${Select[proj][peptide].keySet()}" var="cls">
              <option value="${peptide}_${cls}" class="${peptide}" <g:if test="${(DefaultSelected.peptide==peptide)&&(DefaultSelected.cls==cls)}">selected="selected"</g:if>>${Cls[cls]}</option>
            </g:each>
          </g:each>
        </g:each>
      </select>
    </div>
    <div class="msCellline msSelectionElement">
      <div class="msSelectionTitle">Cell line</div>
      <select id="msCellline" name="msCellline">
        <g:each in="${Select.keySet()}" var="proj">
          <g:each in="${Select[proj].keySet()}" var="peptide">
            <g:each in="${Select[proj][peptide].keySet()}" var="cls">
              <g:each in="${Select[proj][peptide][cls].keySet()}" var="cel">
                <option value="${peptide}_${cls}_${cel}" class="${peptide}_${cls}" <g:if test="${(DefaultSelected.peptide==peptide)&&(DefaultSelected.cls==cls)&&(DefaultSelected.cellline==cel)}">selected="selected"</g:if>>${Celllines[cel]}</option>
              </g:each>
            </g:each>
          </g:each>
        </g:each>
      </select>
    </div>
    <div class="msRawFile msSelectionElement">
      <div class="msSelectionTitle">Raw file</div>
      <select id="msRawFile" name="msRawFile">
        <g:each in="${Select.keySet()}" var="proj">
          <g:each in="${Select[proj].keySet()}" var="peptide">
            <g:each in="${Select[proj][peptide].keySet()}" var="cls">
              <g:each in="${Select[proj][peptide][cls].keySet()}" var="cel">
                <g:each in="${Select[proj][peptide][cls][cel].keySet()}" var="raw">
                  <option value="${peptide}_${cls}_${cel}_${raw}" class="${peptide}_${cls}_${cel}">${RawFiles[raw]}</option>
                </g:each>
              </g:each>
            </g:each>
          </g:each>
        </g:each>
      </select>
    </div>
    <div class="msScore msSelectionElement">
      <div class="msSelectionTitle">Andromeda score</div>
      <select id="msScore" name="msScore">
        <g:each in="${Select.keySet()}" var="proj">
          <g:each in="${Select[proj].keySet()}" var="peptide">
            <g:each in="${Select[proj][peptide].keySet()}" var="cls">
              <g:each in="${Select[proj][peptide][cls].keySet()}" var="cel">
                <g:each in="${Select[proj][peptide][cls][cel].keySet()}" var="raw">
                  <g:each in="${Select[proj][peptide][cls][cel][raw].sort{it.key}.keySet()}" var="score">
                    <option value="${score}" class="${peptide}_${cls}_${cel}_${raw}">${Select[proj][peptide][cls][cel][raw][score]}</option>
                  </g:each>
                </g:each>
              </g:each>
            </g:each>
          </g:each>
        </g:each>
      </select>
    </div>
    <g:actionSubmit value="Show" controller="Protein" action="showLorikeet" id="showLorikeetButton" style="display:none;"/>
  </g:formRemote>
</div>

<div id="lorikeetPlace"></div>


<script type="text/javascript">msmsSpectraInit();</script>